package com.suyl.callback.highConcurrency.service.impl;

import com.suyl.callback.highConcurrency.service.CallBack;

/**
 * 执行业务的示例
 */
public class B {
    public void excuteMessage(CallBack callback, String question) {
        // 回调信息
        System.out.println(callback.getClass() + "问的问题是：" + question);

        // 模拟执行业务 6s
        try {
            Thread.sleep(6 * 1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        // 回调
        String result = "答案是2";
        callback.solve(result);
    }
}
